﻿<table id="tableview" class="table table-striped table-bordered table-hover">
  <colgroup>
    <col width="20px" />
    <col width="25px" />
    <col width="120px" />
    <col />
    <col />
    <col />
    <col width="120px" />
    <col width="120px" />
    <col width="150px" />
    <col width="50px" />
    <col width="50px" />
  </colgroup>
  <thead>
    <tr>
      <th class="table-checkbox">
        <input type="checkbox" class="group-checkable" data-set="#tableview .checkboxes" />
      </th>
      <th>
      </th>
      <th>
        UID
      </th>
      <th>
        组
      </th>
      <th>
        姓名
      </th>
      <th>
        Email
      </th>
      <th>
        通信电话
      </th>
      <th>
        QQ
      </th>
      <th>
        创建时间
      </th>
      <th>
        状态
      </th>
      <th>
        操作
      </th>
    </tr>
  </thead>
  <tbody>
    @foreach (TBM.Models.User item in Model)
    {
    <tr id="@("tr_" + item.UID)" class="odd gradeX">
      <td>
        <input name="uids" type="checkbox" class="checkboxes" value="@item.UID" />
      </td>
      <td>
          @if (String.IsNullOrEmpty(item.PicUrl)){
            <img data-field="avatar" src="@TBM.Core.Config.DefaultPic" width="25" height="25" />
          }else{
            <img data-field="avatar" src="@(item.PicUrl + "small.png")" width="25" height="25" />
          }
      </td>
      <td>
        @item.UID
      </td>
      <td data-field="groups">
        @item.Groups
      </td>
      <td data-field="fullname">
        @Html.Raw(item.CNName ? item.FirstName + item.LastName : item.LastName + " " + item.FirstName)
      </td>
      <td data-field="email">
        @if (!String.IsNullOrEmpty(item.Email))
        {<a href="mailto:@item.Email">@item.Email</a>}
      </td>
      <td data-field="phone">
        @item.Phone
      </td>
      <td data-field="qq">@item.QQ</td>
      <td>@item.RegisterDate</td>
      <td class="l-status">
        @if (item.IsActive)
        {
        <a href="~/User/ChangeUserStatus?uid=@item.UID&status=false&ajax=true" class="label label-sm label-success">正常</a>
        }
        else
        {
        <a href="~/User/ChangeUserStatus?uid=@item.UID&status=true&ajax=true" class="label label-sm label-warning">停用</a>
        }
      </td>
      <td>
        <a href="~/User/UserDetail?uid=@item.UID&ajax=true&redirect=true" class="label label-sm label-info" data-toggle="modal" data-target="#user_detail_panel">
          <i class="fa fa-laptop"></i> 详情
        </a>
      </td>
    </tr>
    }
  </tbody>
</table>
@Html.Raw(ViewBag.PageNav)